package core.domain.messages;

import java.util.HashSet;
import java.util.Set;

import javax.xml.bind.annotation.XmlRootElement;

import core.domain.IOUtil;
import core.domain.Torrent;

@XmlRootElement
public class GetFilesMessage extends AbstractMessage {
	
	private static final long serialVersionUID = 2904347229612153955L;

	private Set<Torrent> torrentFiles;

	public GetFilesMessage() {
		super(MessageType.GETFILES);
		torrentFiles = new HashSet<Torrent>();
	}

	public Set<Torrent> getTorrentFiles() {
		return torrentFiles;
	}
	
	public void setTorrentFiles(Set<Torrent> torrentFiles) {
		this.torrentFiles = torrentFiles;
	}
	
	
	
	@Override
	public String toString() {
		return "GetFilesMessage [torrentFiles=" + torrentFiles + "]";
	}

	public static void main(String[] args) {
	System.out.println(IOUtil.getInstance(GetFilesMessage.class).objectToString(new GetFilesMessage()));
	System.out.println(IOUtil.getInstance(GetFilesMessage.class).stringToObject(IOUtil.getInstance(GetFilesMessage.class).objectToString(new GetFilesMessage())));
}	
}
